<template>
  <div class="sys-title">
    <div class="sys-title__content">
      <i class="sys-title-icon el-icon-menu"></i>
      {{title}}
    </div>
    <div class="sys-title__tool">
      <slot name="tool"></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'sys-title',
  props: {
    title: String
  },
  data() {
    return {}
  }
}
</script>

<style lang="scss" scoped>
.sys-title {
  position: relative;
  height: 40px;
  color: #000;
  font-size: 16px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  background: rgba(0,0,0,.04);

  &::before {
    content: "";
    display: table;
  }
  &::after {
    clear: both;
  }

  &__content {
    position: absolute;
    left: 0;
    top: 50%;
    padding: 0 1rem;
    transform: translateY(-50%);
    box-sizing: border-box;
    line-height: 20px;
  }

  &-icon {
    color: #1890ff;
    padding-right: .5rem;
  }

  &__tool {
    float: right;
    height: 100%;
    display: flex;
    align-items: center;
    padding-right: 10px;
  }
}
</style>
